var t = function(t) {
    return (t = t.toString())[1] ? t : "0" + t;
};

module.exports = {
    formatTime: function(e) {
        var n = e.getFullYear(), r = e.getMonth() + 1, a = e.getDate(), o = e.getHours(), u = e.getMinutes(), g = e.getSeconds();
        return [ n, r, a ].map(t).join("/") + " " + [ o, u, g ].map(t).join(":");
    },
    formatDate2: function(t) {
        return t.getFullYear() + "年" + (t.getMonth() + 1) + "月" + t.getDate() + "日";
    },
    randomNum: function(t, e) {
        switch (arguments.length) {
          case 1:
            return parseInt(Math.random() * t + 1, 10);

          case 2:
            return parseInt(Math.random() * (e - t + 1) + t, 10);

          default:
            return 0;
        }
    }
};